@layout("/common/_container.html",{bg:"bg-white",js:["/assets/productOrder/productOrder_add.js"]}){

<!--引用百度 jquery-->
<script src="http://libs.baidu.com/jquery/2.0.0/jquery.js"></script>


<!--产品品号添加-->
<div class="layui-body-header">
    <span class="layui-body-header-title">产品添加</span>
</div>

<form id="productOrderForm" lay-filter="productOrderForm" class="layui-form layui-form-pane">
    <fieldset class="layui-elem-field">
        <legend>产品添加</legend>
        <div class="layui-field-box">
            <fieldset class="layui-elem-field layui-field-title">
                <legend>基础信息</legend>
                <div class="layui-row layui-col-space5">
                    <div class="layui-col-xs6">
                        <div class="layui-form-item pane">
                            <label class="layui-form-label">选择产品品号<span
                                    style="color: red;">*</span></label>
                            <div class="layui-input-block">
                                <input id="classification" name="kindId" type="hidden">
                                <input id="name_1" placeholder="产品分类" type="text" class="layui-input"
                                       lay-verify="required" required autocomplete="off"/>
                            </div>
                        </div>
                    </div>
                    <div class="layui-col-xs6">
                        <div class="layui-form-item pane">
                            <label class="layui-form-label">颜色/色号/材质<span
                                    style="color: red;">*</span></label>
                            <div class="layui-input-block">
                                <input id="color" name="material" type="hidden">
                                <input id="colorCategory" placeholder="颜色分类" type="text" class="layui-input"
                                       lay-verify="required" required autocomplete="off"/>
                            </div>
                        </div>
                    </div>
                </div>

                <div class="layui-row layui-col-space5">
                    <div class="layui-col-xs6">
                        <div class="layui-form-item pane">
                            <label class="layui-form-label">默认单位<span
                                    style="color: red;">*</span></label>
                            <div class="layui-input-block">
                                <select id="unit" name="unit" lay-search=""
                                        lay-verify="required"
                                        required>
                                    <option value="">直接选择或搜索选择</option>
                                    @for(item in unit){
                                    <option value="${item.id}">${item.unitName}</option>
                                    @}
                                </select>
                            </div>
                        </div>
                    </div>
                    <div class="layui-col-xs6">
                        <div class="layui-form-item pane">
                            <label class="layui-form-label">最小单位<span
                                    style="color: red;">*</span></label>
                            <div class="layui-input-block">
                                <select id="unitMin" name="unitMin" lay-search=""
                                        lay-verify="required"
                                        required>
                                    <option value="">直接选择或搜索选择</option>
                                    @for(item in unit){
                                    <option value="${item.id}">${item.unitName}</option>
                                    @}
                                </select>
                            </div>
                        </div>
                    </div>

                </div>

                <div class="layui-row layui-col-space5">
                    <div class="layui-col-xs6">
                        <div class="layui-form-item pane">
                            <label class="layui-form-label">最大单位<span
                                    style="color: red;">*</span></label>
                            <div class="layui-input-block">
                                <select id="unitMax" name="unitMax" lay-search=""
                                        lay-verify="required"
                                        required>
                                    <option value="">直接选择或搜索选择</option>
                                    @for(item in unit){
                                    <option value="${item.id}">${item.unitName}</option>
                                    @}
                                </select>
                            </div>
                        </div>
                    </div>
                    <div class="layui-col-xs6">
                        <div class="layui-form-item pane">
                            <label class="layui-form-label">单台体积<span
                                    style="color: red;">*</span></label>
                            <div class="layui-input-block">
                                <input id="unitVolume"
                                       name="unitVolume"
                                       placeholder="请输入单台体积"
                                       type="text"
                                       class="layui-input" lay-verify="required" required
                                       onblur="unitVolumeonblur()"   />
                            </div>
                        </div>
                    </div>
                </div>

                <div class="layui-row layui-col-space5">
                    <div class="layui-col-xs6">
                        <div class="layui-form-item pane">
                            <label class="layui-form-label">单台毛重<span
                                    style="color: red;">*</span></label>
                            <div class="layui-input-block">
                                <input id="unitWeight"
                                       name="unitWeight"
                                       placeholder="请输入含税单价"
                                       type="text"
                                       class="layui-input" lay-verify="required" required
                                       onblur="unitWeightonblur()"      />
                            </div>
                        </div>
                    </div>
                    <div class="layui-col-xs6">
                        <label class="layui-form-label">上市日期<span style="color: red;">*</span></label>
                        <div class="layui-input-block">
                            <input id="timeToMarket" name="timeToMarket" placeholder="请输入上市日期" type="text"
                                   class="layui-input layui-input-date"/>
                        </div>
                    </div>
                </div>


                <div class="layui-row layui-col-space5">
                    <div class="layui-col-xs6">
                        <div class="layui-form-item pane">
                            <label class="layui-form-label">最低起订量<span
                                    style="color: red;">*</span></label>
                            <div class="layui-input-block">
                                <input id="minOrderAmount" name="minOrderAmount" placeholder="请输入最低起订量" type="text"
                                       class="layui-input" lay-verify="required" required/>
                            </div>
                        </div>
                    </div>
                    <div class="layui-col-xs6">
                        <div class="layui-form-item pane">
                            <label class="layui-form-label">最低销售价<span
                                    style="color: red;">*</span></label>
                            <div class="layui-input-block">
                                <input id="minSellingPrice" name="minSellingPrice"
                                       placeholder="请输入最低销售价"
                                       type="text"
                                       class="layui-input" lay-verify="required" required/>
                            </div>
                        </div>
                    </div>
                </div>

                <div class="layui-row layui-col-space5">
                    <div class="layui-col-xs6 ">
                        <div class="layui-form-item pane">
                            <label class="layui-form-label">全国统一价格<span
                                    style="color: red;">*</span></label>
                            <div class="layui-input-block">
                                <input id="uniformSalesPrice" name="uniformSalesPrice"
                                       placeholder="请输入全国统一价格"
                                       type="text"
                                       class="layui-input" lay-verify="required" required/>
                            </div>
                        </div>
                    </div>
                    <div class="layui-col-xs6">
                        <div class="layui-form-item pane">
                            <label class="layui-form-label">换算比例<span
                                    style="color: red;">*</span></label>
                            <div class="layui-input-block">
                                <input id="conversionRatio" name="conversionRatio"
                                       placeholder="请输入换算比例"
                                       type="text"
                                       class="layui-input" lay-verify="required" required/>
                            </div>
                        </div>
                    </div>
                </div>

                <div class="layui-row layui-col-space5">
                    <div class="layui-col-xs6 ">
                        <div class="layui-form-item pane">
                            <label class="layui-form-label">产品品号<span
                                    style="color: red;">*</span></label>
                            <div class="layui-input-block">
                                <input id="productOrderName" name="productOrderName"
                                       placeholder="请输入产品名"
                                       type="text"
                                       class="layui-input" lay-verify="required" required/>
                            </div>
                        </div>
                    </div>
                    <div class="layui-col-xs6">
                        <div class="layui-form-item pane">
                            <label class="layui-form-label">两地费<span
                                    style="color: red;">*</span></label>
                            <div class="layui-input-block">
                                <input id="bothfee" name="bothfee"
                                       placeholder="请输入两地费"
                                       type="text"
                                       class="layui-input" lay-verify="required" required/>
                            </div>
                        </div>
                    </div>
                </div>

                <div class="layui-row layui-col-space5">
                    <div class="layui-col-xs6 ">
                        <div class="layui-form-item pane">
                            <label class="layui-form-label">备注<span
                                    style="color: red;">*</span></label>
                            <div class="layui-input-block">
                                <input id="remark" name="remark"
                                       placeholder="请输入备注信息"
                                       type="text"
                                       class="layui-input" lay-verify="required" required/>
                            </div>
                        </div>
                    </div>
                    <div class="layui-col-xs6">
                        <div class="layui-form-item pane">
                            <label class="layui-form-label">20尺码<span
                                    style="color: red;">*</span></label>
                            <div class="layui-input-block">
                                <input id="two" name="two"
                                       placeholder="请输入20尺码"
                                       type="text"
                                       class="layui-input" lay-verify="required" required/>
                            </div>
                        </div>
                    </div>
                </div>

                <div class="layui-row layui-col-space5">
                    <div class="layui-col-xs6 ">
                        <div class="layui-form-item pane">
                            <label class="layui-form-label">40尺码<span
                                    style="color: red;">*</span></label>
                            <div class="layui-input-block">
                                <input id="four" name="four"
                                       placeholder="请输入40尺码"
                                       type="text"
                                       class="layui-input" lay-verify="required" required/>
                            </div>
                        </div>
                    </div>
                    <div class="layui-col-xs6">
                        <div class="layui-form-item pane">
                            <label class="layui-form-label">40尺码HQ<span
                                    style="color: red;">*</span></label>
                            <div class="layui-input-block">
                                <input id="fourHQ" name="fourHQ"
                                       placeholder="请输入fourHQ尺码"
                                       type="text"
                                       class="layui-input" lay-verify="required" required/>
                            </div>
                        </div>
                    </div>
                </div>

            </fieldset>
            <fieldset class="layui-elem-field layui-field-title">
                <legend>产品图片</legend>
                <div class="layui-field-box" id="imagesBox">
                    <input id="picPath" name="picPath" type="hidden">
                    <div class="layui-upload">

                        <div class="layui-upload-list">
                            <table class="layui-table">
                                <thead>
                                <tr>
                                    <th>文件名</th>
                                    <th>图像</th>
                                    <th>状态</th>
                                    <th>操作</th>
                                </tr>
                                </thead>
                                <tbody id="imageList"></tbody>
                            </table>
                        </div>
                        <button type="button" style="float: right" class="layui-btn" id="start"><i
                                class="layui-icon layui-icon-upload"></i>开始上传
                        </button>
                        <button type="button" style="float: right;margin-right: 10px"
                                class="layui-btn-primary layui-btn" id="selectFile"><i
                                class="layui-icon layui-icon-add-1"></i>选择图片
                        </button>
                    </div>
                </div>
            </fieldset>


            <!--产品附件-->
            <fieldset class="layui-elem-field layui-field-title">
                <legend>附件</legend>
                <div class="layui-field-box" id="imagesBox2">
                    <input id="reportCertificate" name="reportCertificate" type="hidden" >
                    <div class="layui-upload">
                        <div class="layui-upload-list">
                            <table class="layui-table">
                                <thead>
                                <tr>
                                    <th>文件名</th>
                                    <th>图像</th>
                                    <th>状态</th>
                                    <th>操作</th>
                                </tr>
                                </thead>
                                <tbody id="imageList2"></tbody>
                            </table>
                        </div>
                        <button type="button" style="float: right" class="layui-btn" id="start2"><i class="layui-icon layui-icon-upload"></i>开始上传</button>
                        <button type="button" style="float: right;margin-right: 10px" class="layui-btn-primary layui-btn" id="selectFile2"><i class="layui-icon layui-icon-add-1"></i>选择附件
                        </button>
                        <a href="https://hybn-1259512846.cos.ap-chengdu.myqcloud.com/温州项目下载附件.doc">
                            <button type="button" style="float: right;margin-right: 10px" class="layui-btn-primary layui-btn" id="downloadFile"><i class="layui-icon layui-icon-add-1"></i>下载附件
                            </button>
                        </a>
                    </div>
                </div>
            </fieldset>


        </div>
    </fieldset>

    <div class="layui-form-item pane text-right">
        <button class="layui-btn layui-btn-primary" type="button" id="backupPage">取消</button>
        <button class="layui-btn" lay-filter="btnSubmit" lay-submit>保存</button>
    </div>
</form>




<script type="text/javascript">

    //单台体积鼠标丢失事件
    function unitVolumeonblur() {
        var lume = $("#unitVolume").val();
        var unitVolume = Math.round(lume*100)/100;
        var xsd = unitVolume.toString().split(".");
        if(xsd.length==1){
            unitVolume=unitVolume.toString()+".00";
            $("#unitVolume").val(unitVolume);
        }
        if(xsd.length>1){
            if(xsd[1].length<2){
                unitVolume=unitVolume.toString()+"0";
            }
            $("#unitVolume").val(unitVolume);
        }
    }


    //单台毛重鼠标丢失事件
    function unitWeightonblur() {
        var Weight = $("#unitWeight").val();
        var unitWeight = Math.round(Weight*100)/100;
        var xsd = unitWeight.toString().split(".");
        if(xsd.length==1){
            unitWeight=unitWeight.toString()+".00";
            $("#unitWeight").val(unitWeight);
        }
        if(xsd.length>1){
            if(xsd[1].length<2){
                unitWeight=unitWeight.toString()+"0";
            }
            $("#unitWeight").val(unitWeight);
        }
    }















</script>












@}